package com.hzwq.demo2.permission.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author zhaochunlin
 * @since 2020-08-13
 */
@TableName("permission")
public class Permission extends Model<Permission> {

    private static final long serialVersionUID = 1L;

    /**
     * 劝你西安编号
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 权限名称
     */
    @TableField("name")
    private String name;

    /**
     * 父权限id
     */
    @TableField("pid")
    private Integer pid;

    /**
     * 权限排序
     */
    @TableField("zindex")
    private Integer zindex;

    /**
     * 权限分类（0 菜单；1 功能）
     */
    @TableField("istype")
    private Integer istype;

    /**
     * 描述
     */
    @TableField("descpt")
    private String descpt;

    /**
     * 权限编号
     */
    @TableField("code")
    private String code;

    /**
     * 权限图标名称
     */
    @TableField("icon")
    private String icon;

    /**
     * 权限url
     */
    @TableField("page")
    private String page;

    /**
     * 操作用户id
     */
    @TableField("insert_uid")
    private Integer insertUid;

    /**
     * 添加时间
     */
    @TableField("insert_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date insertTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public Integer getZindex() {
        return zindex;
    }

    public void setZindex(Integer zindex) {
        this.zindex = zindex;
    }

    public Integer getIstype() {
        return istype;
    }

    public void setIstype(Integer istype) {
        this.istype = istype;
    }

    public String getDescpt() {
        return descpt;
    }

    public void setDescpt(String descpt) {
        this.descpt = descpt;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getPage() {
        return page;
    }

    public void setPage(String page) {
        this.page = page;
    }

    public Integer getInsertUid() {
        return insertUid;
    }

    public void setInsertUid(Integer insertUid) {
        this.insertUid = insertUid;
    }

    public Date getInsertTime() {
        return insertTime;
    }

    public void setInsertTime(Date insertTime) {
        this.insertTime = insertTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Permission{" + "id=" + id + ", name=" + name + ", pid=" + pid + ", zindex=" + zindex + ", istype="
                + istype + ", descpt=" + descpt + ", code=" + code + ", icon=" + icon + ", page=" + page
                + ", insertUid=" + insertUid + ", insertTime=" + insertTime + ", updateTime=" + updateTime + "}";
    }
}
